/*
 * Funny Language - a free style programming language.
 * Copyright (C) 2015 by fanguangping (fanguangping@163.com)
 * init.h
 */

#ifndef INIT_H_
#define INIT_H_

#include <stdio.h>
#include "../ds/datastructure.h"
#include "../scheme/basic/ds.h"

#define FUNNY_HOME      "FUNNY_HOME"
#define SYS_MACRO_FILE  "/sys.macro"
#define SYS_INIT_FILE   "/funny/init.fn"

typedef struct _Funny {
	const char *cwd;  //current working directory
	Scheme *sc;
} Funny;

Trie *mappingTrie;
Queue *mappings;
Queue *functions;

int funny_init(Funny *funny, Scheme *sc);
void add_mapping_to_trie(Mapping *mapping);
Queue *get_mappings(Statement *s);
Queue *get_functions();
void parse_sys_macro(String fileName);

#endif /* INIT_H_ */
